﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using MP.Core.Library;
using MP.LayerHelper.MP_OBS.BLL;

public partial class Member_Tools_Control_PagesLog : MP.Core.Authentication.Control.AuthenBase
{
    public string date;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (FDateTime.IsDate(Request["date"]))
            {
                date = Request["date"];
            }
            else
            {
                date = DateTime.Now.ToString("dd/MM/yyyy");
            }

            txtNgay.Text = date;

            loadData();
        }
    }

    void loadData()
    {
        DataTable tbl = MbLogPageManager.CreateInstant().GetLogByDate(FDateTime.ConvertDate(date), BranchId);
        rep.DataSource = tbl;
        rep.DataBind();
    }

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        Response.Redirect(Request.Url.AbsolutePath + "?date=" + Server.UrlEncode(txtNgay.Text));
    }
}
